package org.hishen.example.entity.mall;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;

import org.hibernate.validator.constraints.NotBlank;
import org.hibernate.validator.constraints.Range;
import org.hishen.example.entity.AbstractBaseEntity;
import org.hishenframework.data.annotation.Label;

@Entity
@Table(name = "mall_category")
@Label("类别")
public class Category extends AbstractBaseEntity {

	private static final long serialVersionUID = 1L;

	@Id
	@GeneratedValue(strategy = GenerationType.AUTO)
	private Integer id;
	
	/** 类别名称 */
	@Label("类别名称")
	@NotBlank
	private String categoryname;
	
	/** 索引(排序用) */
	@Label("顺序")
	@NotNull
	@Range(min = -100, max = 100)
	private Integer categoryIndex;
	
	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public String getCategoryname() {
		return categoryname;
	}

	public void setCategoryname(String categoryname) {
		this.categoryname = categoryname;
	}

	public Integer getCategoryIndex() {
		return categoryIndex;
	}

	public void setCategoryIndex(Integer categoryIndex) {
		this.categoryIndex = categoryIndex;
	}
}
